execute if items entity @s hotbar.8 * run function util:drop_item/drop_set_owner_tp_owner {slot:"hotbar.8",slot_byte:"8"}

summon armor_stand ~ ~ ~ {Tags:["tempEntity"]}
data modify entity @n[tag=tempEntity,distance=..1,type=armor_stand] HandItems[0] set from entity @s Inventory[{components:{"minecraft:custom_data":{id:"arrow_bundle"}}}]
clear @s *[custom_data~{id:"arrow_bundle"}]
item replace entity @s hotbar.8 from entity @n[tag=tempEntity,type=armor_stand,distance=..1] weapon.mainhand
kill @n[tag=tempEntity,type=armor_stand,distance=..1]